*Generating weights
gen w23=.
replace w23=.47572315 if country=="Austria"
replace w23=2.9143935 if country=="Germany"
replace w23=3.3433787 if country=="United Kingdom"
replace w23=3.2682777 if country=="Italy"
replace w23=.87088033 if country=="Netherlands"
replace w23=3.4266928 if country=="France"
replace w23=2.1132478 if country=="Poland"
replace w23=.05794021 if country=="Luxembourg"
replace w23=.30027869 if country=="Denmark"
replace w23=.54127298 if country=="Hungary"
replace w23=.58848642 if country=="Belgium"
replace w23=.49399435 if country=="Sweden"
replace w23=.54170137 if country=="Portugal"
replace w23=.24155347 if country=="Croatia"
replace w23=2.508488 if country=="Spain"
replace w23=.27670584 if country=="Slovakia"
replace w23=.110289 if country=="Slovenia"
replace w23=.30373829 if country=="Finland"
replace w23=.58955447 if country=="Czech Republic"
replace w23=.20535245 if country=="Ireland"
replace w23=.63167404 if country=="Greece"
replace w23=.16103299 if country=="Lithuania"
replace w23=1.0378083 if country=="Romania"
replace w23=.07373688 if country=="Estonia"
replace w23=.10931864 if country=="Latvia"
replace w23=.04643351 if country=="Malta"
replace w23=.09423911 if country=="Cyprus"
replace w23=.40550607 if country=="Bulgaria"


*cluster on means
cluster ward mean_performance mean_instrumental mean_identity mean_political, name(mean_cluster)
cluster dendrogram mean_cluster
gsort -mean_cluster_hgt
gen increase = mean_cluster_hgt - mean_cluster_hgt[_n+1]
list mean_cluster* increase in 1/28, clean

clustermat stop, variables(mean_performance mean_instrumental mean_identity mean_political)
clustermat stop, variables(mean_performance mean_instrumental mean_identity mean_political) rule(duda)



cluster generate mean_cluster_6 = group(6)



tab country, sum(mean_performance)
tab country, sum(mean_instrumental)
tab country, sum(mean_identity)
tab country, sum(mean_political)
tab country, sum(slope_performance)
tab country, sum(slope_instrumental)
tab country, sum(slope_identity)
tab country, sum(slope_political)

sort mean_cluster_6
by mean_cluster_6: sum(mean_performance mean_instrumental mean_identity mean_political)



